Skip to content

Update ruff and fix linting issues#511

Merged
mathialo merged 3 commits intomasterfrom
fix-lints
Mar 20, 2026
Merged

Update ruff and fix linting issues#511
mathialo merged 3 commits intomasterfrom
fix-lints

Conversation

@mathialo
Copy link
Copy Markdown
Contributor

The version of ruff linked in the pre-commit was very old, and was
missing several issues.

This PR updates the checks in the pre-commit config. It also moves
tool.uv.dev-dependencies to dependency-groups.dev since that's the
non-deprecated way of doing that.

The version of ruff linked in the pre-commit was very old, and was
missing several issues.

This PR updates the checks in the pre-commit config. It also moves
`tool.uv.dev-dependencies` to `dependency-groups.dev` since that's the
non-deprecated way of doing that.
@mathialo mathialo requested a review from a team as a code owner March 19, 2026 09:08
@mathialo
Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request modernizes the project's development tooling and dependency management. It updates ruff and pre-commit-hooks to their latest versions, which necessitated resolving various linting issues, predominantly through consistent import reordering. The project's pyproject.toml has also been refactored to align with current best practices for declaring development dependencies.

Highlights

  • Tooling Updates: Updated ruff and pre-commit-hooks to their latest versions in the pre-commit configuration, ensuring modern linting and formatting standards are applied.
  • Dependency Management Refinement: Refactored pyproject.toml to migrate development dependencies from tool.uv.dev-dependencies to the recommended dependency-groups.dev section, along with updating mypy and ruff versions.
  • Linting Issue Resolution: Addressed numerous linting issues across the codebase, primarily by reordering imports to comply with the updated ruff rules and improving code consistency.
  • Code Improvements: Introduced more precise type hinting in cognite/extractorutils/util.py and simplified a conditional assignment in cognite/extractorutils/uploader_extractor.py for cleaner code.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully updates ruff and other dependencies, and applies the resulting linting fixes across the codebase. The changes, which are mostly stylistic improvements like import reordering, enhance code quality and consistency. The configuration changes in pyproject.toml are also correct. I found no issues with this pull request.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully updates the ruff linter and pre-commit-hooks to their latest versions, addressing several linting issues across the codebase. The changes include reordering imports for better consistency, adopting the non-deprecated dependency-groups.dev configuration in pyproject.toml, and making minor code style improvements such as using _ for unused variables and more Pythonic conditional assignments. Overall, these changes enhance code quality, maintainability, and ensure the project adheres to updated linting standards. No further issues or improvement opportunities were identified in the changed lines.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 96.15385% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.25%. Comparing base (2705aa5) to head (f6132f5).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
cognite/extractorutils/uploader_extractor.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #511   +/-   ##
=======================================
  Coverage   81.25%   81.25%           
=======================================
  Files          43       43           
  Lines        4210     4210           
=======================================
  Hits         3421     3421           
  Misses        789      789           
Files with missing lines Coverage Δ
cognite/extractorutils/base.py 57.14% <100.00%> (ø)
cognite/extractorutils/configtools/elements.py 80.37% <100.00%> (ø)
cognite/extractorutils/configtools/loaders.py 85.33% <100.00%> (ø)
cognite/extractorutils/metrics.py 93.83% <100.00%> (ø)
cognite/extractorutils/statestore/hashing.py 46.22% <ø> (ø)
cognite/extractorutils/statestore/watermark.py 92.66% <ø> (ø)
...e/extractorutils/unstable/configuration/loaders.py 53.01% <100.00%> (ø)
...te/extractorutils/unstable/configuration/models.py 84.85% <100.00%> (ø)
...ite/extractorutils/unstable/core/checkin_worker.py 91.04% <100.00%> (ø)
cognite/extractorutils/unstable/core/runtime.py 70.00% <100.00%> (ø)
... and 10 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

einarmo
einarmo previously approved these changes Mar 20, 2026
Copy link
Copy Markdown
Contributor

@einarmo einarmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦄

Copy link
Copy Markdown
Contributor

@einarmo einarmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦄

@mathialo mathialo merged commit 1089e2c into master Mar 20, 2026
7 checks passed
@mathialo mathialo deleted the fix-lints branch March 20, 2026 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants